package schema

type AdminUser struct {
	Id              int64  `gorm:"column:id;type:bigint(20);primary_key;AUTO_INCREMENT" json:"id"`
	Account         string `gorm:"column:account;type:varchar(100);comment:用户账号;NOT NULL" json:"account"`
	Password        string `gorm:"column:password;type:varchar(255);comment:用户密码;NOT NULL" json:"password"`
	Phone           string `gorm:"column:phone;type:char(15);NOT NULL" json:"phone"`
	PhoneCode       string `gorm:"column:phone_code;type:char(10);comment:手机区号" json:"phone_code"`
	Nickname        string `gorm:"column:nickname;type:varchar(100);comment:用户昵称;NOT NULL" json:"nickname"`
	Role            int32  `gorm:"column:role;type:tinyint(4);comment:用户角色;NOT NULL" json:"role"`
	RegisterAt      int64  `gorm:"column:register_at;type:bigint(20);comment:注册时间" json:"register_at"`
	LoginAt         int64  `gorm:"column:login_at;type:bigint(20);comment:登录时间;NOT NULL" json:"login_at"`
	LoginIp         string `gorm:"column:login_ip;type:varchar(20);comment:登录ip" json:"login_ip"`
	LoginNumber     int    `gorm:"column:login_number;type:int(11);default:0;comment:登录次数;NOT NULL" json:"login_number"`
	UserStatus      int32  `gorm:"column:user_status;type:tinyint(1);default:0;comment:用户状态 0.正常1.禁用;NOT NULL" json:"user_status"`
	LoginStatus     int32  `gorm:"column:login_status;type:tinyint(1);default:0;comment:登录状态 0.离线 1.在线;NOT NULL" json:"login_status"`
	GoogleCode      string `gorm:"column:google_code;type:varchar(50);comment:谷歌验证码" json:"google_code"`
	IsOpenGoogle    int32  `gorm:"column:is_open_google;type:tinyint(1);default:0;comment:是否打开谷歌验证 0.关闭 1.打开;NOT NULL" json:"is_open_google"`
	IsBindingGoogle int32  `gorm:"column:is_binding_google;type:tinyint(1);default:0;comment:是否绑定谷歌二维码：0.未绑定 1.绑定;NOT NULL" json:"is_binding_google"`
	HeadPictureUrl  string `gorm:"column:head_picture_url;type:varchar(255);comment:头像图片地址" json:"head_picture_url"`
}

func (u AdminUser) TableName() string {
	return "admin_users"
}
